home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Programming / gcc-2.95.3-3 / info / gcc.info-2 < prev    next >
Encoding:
GNU Info File  |  2001-07-15  |  34.6 KB  |  852 lines

  1. This is Info file gcc.info, produced by Makeinfo version 1.68 from the
  2. input file ./gcc.texi.
  3.  
  4. INFO-DIR-SECTION Programming
  5. START-INFO-DIR-ENTRY
  6. * gcc: (gcc).                  The GNU Compiler Collection.
  7. END-INFO-DIR-ENTRY
  8.    This file documents the use and the internals of the GNU compiler.
  9.  
  10.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  11. Boston, MA 02111-1307 USA
  12.  
  13.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
  14. 1999, 2000 Free Software Foundation, Inc.
  15.  
  16.    Permission is granted to make and distribute verbatim copies of this
  17. manual provided the copyright notice and this permission notice are
  18. preserved on all copies.
  19.  
  20.    Permission is granted to copy and distribute modified versions of
  21. this manual under the conditions for verbatim copying, provided also
  22. that the sections entitled "GNU General Public License" and "Funding
  23. for Free Software" are included exactly as in the original, and
  24. provided that the entire resulting derived work is distributed under
  25. the terms of a permission notice identical to this one.
  26.  
  27.    Permission is granted to copy and distribute translations of this
  28. manual into another language, under the above conditions for modified
  29. versions, except that the sections entitled "GNU General Public
  30. License" and "Funding for Free Software", and this permission notice,
  31. may be included in translations approved by the Free Software Foundation
  32. instead of in the original English.
  33.  
  34. 
  35. File: gcc.info,  Node: C++ Dialect Options,  Next: Warning Options,  Prev: C Dialect Options,  Up: Invoking GCC
  36.  
  37. Options Controlling C++ Dialect
  38. ===============================
  39.  
  40.    This section describes the command-line options that are only
  41. meaningful for C++ programs; but you can also use most of the GNU
  42. compiler options regardless of what language your program is in.  For
  43. example, you might compile a file `firstClass.C' like this:
  44.  
  45.      g++ -g -frepo -O -c firstClass.C
  46.  
  47. In this example, only `-frepo' is an option meant only for C++
  48. programs; you can use the other options with any language supported by
  49. GCC.
  50.  
  51.    Here is a list of options that are *only* for compiling C++ programs:
  52.  
  53. `-fno-access-control'
  54.      Turn off all access checking.  This switch is mainly useful for
  55.      working around bugs in the access control code.
  56.  
  57. `-fcheck-new'
  58.      Check that the pointer returned by `operator new' is non-null
  59.      before attempting to modify the storage allocated.  The current
  60.      Working Paper requires that `operator new' never return a null
  61.      pointer, so this check is normally unnecessary.
  62.  
  63.      An alternative to using this option is to specify that your
  64.      `operator new' does not throw any exceptions; if you declare it
  65.      `throw()', g++ will check the return value.  See also `new
  66.      (nothrow)'.
  67.  
  68. `-fconserve-space'
  69.      Put uninitialized or runtime-initialized global variables into the
  70.      common segment, as C does.  This saves space in the executable at
  71.      the cost of not diagnosing duplicate definitions.  If you compile
  72.      with this flag and your program mysteriously crashes after
  73.      `main()' has completed, you may have an object that is being
  74.      destroyed twice because two definitions were merged.
  75.  
  76.      This option is no longer useful on most targets, now that support
  77.      has been added for putting variables into BSS without making them
  78.      common.
  79.  
  80. `-fdollars-in-identifiers'
  81.      Accept `$' in identifiers.  You can also explicitly prohibit use of
  82.      `$' with the option `-fno-dollars-in-identifiers'.  (GNU C allows
  83.      `$' by default on most target systems, but there are a few
  84.      exceptions.)  Traditional C allowed the character `$' to form part
  85.      of identifiers.  However, ANSI C and C++ forbid `$' in identifiers.
  86.  
  87. `-fno-elide-constructors'
  88.      The C++ standard allows an implementation to omit creating a
  89.      temporary which is only used to initialize another object of the
  90.      same type.  Specifying this option disables that optimization, and
  91.      forces g++ to call the copy constructor in all cases.
  92.  
  93. `-fexternal-templates'
  94.      Cause template instantiations to obey `#pragma interface' and
  95.      `implementation'; template instances are emitted or not according
  96.      to the location of the template definition.  *Note Template
  97.      Instantiation::, for more information.
  98.  
  99.      This option is deprecated.
  100.  
  101. `-falt-external-templates'
  102.      Similar to -fexternal-templates, but template instances are
  103.      emitted or not according to the place where they are first
  104.      instantiated.  *Note Template Instantiation::, for more
  105.      information.
  106.  
  107.      This option is deprecated.
  108.  
  109. `-ffor-scope'
  110. `-fno-for-scope'
  111.      If -ffor-scope is specified, the scope of variables declared in a
  112.      for-init-statement is limited to the `for' loop itself, as
  113.      specified by the draft C++ standard.  If -fno-for-scope is
  114.      specified, the scope of variables declared in a for-init-statement
  115.      extends to the end of the enclosing scope, as was the case in old
  116.      versions of gcc, and other (traditional) implementations of C++.
  117.  
  118.      The default if neither flag is given to follow the standard, but
  119.      to allow and give a warning for old-style code that would
  120.      otherwise be invalid, or have different behavior.
  121.  
  122. `-fno-gnu-keywords'
  123.      Do not recognize `classof', `headof', `signature', `sigof' or
  124.      `typeof' as a keyword, so that code can use these words as
  125.      identifiers.  You can use the keywords `__classof__',
  126.      `__headof__', `__signature__', `__sigof__', and `__typeof__'
  127.      instead.  `-ansi' implies `-fno-gnu-keywords'.
  128.  
  129. `-fguiding-decls'
  130.      Treat a function declaration with the same type as a potential
  131.      function template instantiation as though it declares that
  132.      instantiation, not a normal function.  If a definition is given
  133.      for the function later in the translation unit (or another
  134.      translation unit if the target supports weak symbols), that
  135.      definition will be used; otherwise the template will be
  136.      instantiated.  This behavior reflects the C++ language prior to
  137.      September 1996, when guiding declarations were removed.
  138.  
  139.      This option implies `-fname-mangling-version-0', and will not work
  140.      with other name mangling versions.  Like all options that change
  141.      the ABI, all C++ code, *including libgcc.a* must be built with the
  142.      same setting of this option.
  143.  
  144. `-fhandle-signatures'
  145.      Recognize the `signature' and `sigof' keywords for specifying
  146.      abstract types.  The default (`-fno-handle-signatures') is not to
  147.      recognize them.  *Note Type Abstraction using Signatures: C++
  148.      Signatures.
  149.  
  150. `-fhonor-std'
  151.      Treat the `namespace std' as a namespace, instead of ignoring it.
  152.      For compatibility with earlier versions of g++, the compiler will,
  153.      by default, ignore `namespace-declarations', `using-declarations',
  154.      `using-directives', and `namespace-names', if they involve `std'.
  155.  
  156. `-fhuge-objects'
  157.      Support virtual function calls for objects that exceed the size
  158.      representable by a `short int'.  Users should not use this flag by
  159.      default; if you need to use it, the compiler will tell you so.
  160.  
  161.      This flag is not useful when compiling with -fvtable-thunks.
  162.  
  163.      Like all options that change the ABI, all C++ code, *including
  164.      libgcc* must be built with the same setting of this option.
  165.  
  166. `-fno-implicit-templates'
  167.      Never emit code for non-inline templates which are instantiated
  168.      implicitly (i.e. by use); only emit code for explicit
  169.      instantiations.  *Note Template Instantiation::, for more
  170.      information.
  171.  
  172. `-fno-implicit-inline-templates'
  173.      Don't emit code for implicit instantiations of inline templates,
  174.      either.  The default is to handle inlines differently so that
  175.      compiles with and without optimization will need the same set of
  176.      explicit instantiations.
  177.  
  178. `-finit-priority'
  179.      Support `__attribute__ ((init_priority (n)))' for controlling the
  180.      order of initialization of file-scope objects.  On ELF targets,
  181.      this requires GNU ld 2.10 or later.
  182.  
  183. `-fno-implement-inlines'
  184.      To save space, do not emit out-of-line copies of inline functions
  185.      controlled by `#pragma implementation'.  This will cause linker
  186.      errors if these functions are not inlined everywhere they are
  187.      called.
  188.  
  189. `-fname-mangling-version-N'
  190.      Control the way in which names are mangled.  Version 0 is
  191.      compatible with versions of g++ before 2.8.  Version 1 is the
  192.      default.  Version 1 will allow correct mangling of function
  193.      templates.  For example, version 0 mangling does not mangle
  194.      foo<int, double> and foo<int, char> given this declaration:
  195.  
  196.           template <class T, class U> void foo(T t);
  197.  
  198.      Like all options that change the ABI, all C++ code, *including
  199.      libgcc* must be built with the same setting of this option.
  200.  
  201. `-foperator-names'
  202.      Recognize the operator name keywords `and', `bitand', `bitor',
  203.      `compl', `not', `or' and `xor' as synonyms for the symbols they
  204.      refer to.  `-ansi' implies `-foperator-names'.
  205.  
  206. `-fno-optional-diags'
  207.      Disable diagnostics that the standard says a compiler does not
  208.      need to issue.  Currently, the only such diagnostic issued by g++
  209.      is the one for a name having multiple meanings within a class.
  210.  
  211. `-fpermissive'
  212.      Downgrade messages about nonconformant code from errors to
  213.      warnings.  By default, g++ effectively sets `-pedantic-errors'
  214.      without `-pedantic'; this option reverses that.  This behavior and
  215.      this option are superceded by `-pedantic', which works as it does
  216.      for GNU C.
  217.  
  218. `-frepo'
  219.      Enable automatic template instantiation.  This option also implies
  220.      `-fno-implicit-templates'.  *Note Template Instantiation::, for
  221.      more information.
  222.  
  223. `-fno-rtti'
  224.      Disable generation of the information used by C++ runtime type
  225.      identification features (`dynamic_cast' and `typeid').  If you
  226.      don't use those parts of the language (or exception handling,
  227.      which uses `dynamic_cast' internally), you can save some space by
  228.      using this flag.
  229.  
  230. `-fstrict-prototype'
  231.      Within an `extern "C"' linkage specification, treat a function
  232.      declaration with no arguments, such as `int foo ();', as declaring
  233.      the function to take no arguments.  Normally, such a declaration
  234.      means that the function `foo' can take any combination of
  235.      arguments, as in C.  `-pedantic' implies `-fstrict-prototype'
  236.      unless overridden with `-fno-strict-prototype'.
  237.  
  238.      Specifying this option will also suppress implicit declarations of
  239.      functions.
  240.  
  241.      This flag no longer affects declarations with C++ linkage.
  242.  
  243. `-fsquangle'
  244. `-fno-squangle'
  245.      `-fsquangle' will enable a compressed form of name mangling for
  246.      identifiers. In particular, it helps to shorten very long names by
  247.      recognizing types and class names which occur more than once,
  248.      replacing them with special short ID codes.  This option also
  249.      requires any C++ libraries being used to be compiled with this
  250.      option as well.  The compiler has this disabled (the equivalent of
  251.      `-fno-squangle') by default.
  252.  
  253.      Like all options that change the ABI, all C++ code, *including
  254.      libgcc.a* must be built with the same setting of this option.
  255.  
  256. `-ftemplate-depth-N'
  257.      Set the maximum instantiation depth for template classes to N.  A
  258.      limit on the template instantiation depth is needed to detect
  259.      endless recursions during template class instantiation. ANSI/ISO
  260.      C++ conforming programs must not rely on a maximum depth greater
  261.      than 17.
  262.  
  263. `-fthis-is-variable'
  264.      Permit assignment to `this'.  The incorporation of user-defined
  265.      free store management into C++ has made assignment to `this' an
  266.      anachronism.  Therefore, by default it is invalid to assign to
  267.      `this' within a class member function; that is, GNU C++ treats
  268.      `this' in a member function of class `X' as a non-lvalue of type
  269.      `X *'.  However, for backwards compatibility, you can make it
  270.      valid with `-fthis-is-variable'.
  271.  
  272. `-fvtable-thunks=THUNKS-VERSION'
  273.      Use `thunks' to implement the virtual function dispatch table
  274.      (`vtable').  The traditional (cfront-style) approach to
  275.      implementing vtables was to store a pointer to the function and two
  276.      offsets for adjusting the `this' pointer at the call site.  Newer
  277.      implementations store a single pointer to a `thunk' function which
  278.      does any necessary adjustment and then calls the target function.
  279.  
  280.      The original implementation of thunks (version 1) had a bug
  281.      regarding virtual base classes; this bug is fixed with version 2
  282.      of the thunks implementation. With setting the version to 2,
  283.      compatibility to the version 1 thunks is provided, at the cost of
  284.      extra machine code. Version 3 does not include this compatibility.
  285.  
  286.      This option also enables a heuristic for controlling emission of
  287.      vtables; if a class has any non-inline virtual functions, the
  288.      vtable will be emitted in the translation unit containing the
  289.      first one of those.
  290.  
  291.      Like all options that change the ABI, all C++ code, *including
  292.      libgcc.a* must be built with the same setting of this option. Since
  293.      version 1 and version 2 are also incompatible (for classes with
  294.      virtual bases defining virtual functions), all code must also be
  295.      compiled with the same version.
  296.  
  297.      In this version of gcc, there are no targets for which version 2
  298.      thunks are the default.  On all targets, not giving the option
  299.      will use the traditional implementation, and -fvtable-thunks will
  300.      produce version 2 thunks.
  301.  
  302. `-nostdinc++'
  303.      Do not search for header files in the standard directories
  304.      specific to C++, but do still search the other standard
  305.      directories.  (This option is used when building the C++ library.)
  306.  
  307.    In addition, these optimization, warning, and code generation options
  308. have meanings only for C++ programs:
  309.  
  310. `-fno-default-inline'
  311.      Do not assume `inline' for functions defined inside a class scope.
  312.      *Note Options That Control Optimization: Optimize Options.  Note
  313.      that these functions will have linkage like inline functions; they
  314.      just won't be inlined by default.
  315.  
  316. `-Wctor-dtor-privacy (C++ only)'
  317.      Warn when a class seems unusable, because all the constructors or
  318.      destructors in a class are private and the class has no friends or
  319.      public static member functions.
  320.  
  321. `-Wnon-virtual-dtor (C++ only)'
  322.      Warn when a class declares a non-virtual destructor that should
  323.      probably be virtual, because it looks like the class will be used
  324.      polymorphically.
  325.  
  326. `-Wreorder (C++ only)'
  327.      Warn when the order of member initializers given in the code does
  328.      not match the order in which they must be executed.  For instance:
  329.  
  330.           struct A {
  331.             int i;
  332.             int j;
  333.             A(): j (0), i (1) { }
  334.           };
  335.  
  336.      Here the compiler will warn that the member initializers for `i'
  337.      and `j' will be rearranged to match the declaration order of the
  338.      members.
  339.  
  340.    The following `-W...' options are not affected by `-Wall'.
  341.  
  342. `-Weffc++ (C++ only)'
  343.      Warn about violations of various style guidelines from Scott
  344.      Meyers' `Effective C++' books.  If you use this option, you should
  345.      be aware that the standard library headers do not obey all of
  346.      these guidelines; you can use `grep -v' to filter out those
  347.      warnings.
  348.  
  349. `-Wno-deprecated (C++ only)'
  350.      Do not warn about usage of deprecated features. *Note Deprecated
  351.      Features::.
  352.  
  353. `-Wno-non-template-friend (C++ only)'
  354.      Disable warnings when non-templatized friend functions are declared
  355.      within a template. With the advent of explicit template
  356.      specification support in g++, if the name of the friend is an
  357.      unqualified-id (ie, `friend foo(int)'), the C++ language
  358.      specification demands that the friend declare or define an
  359.      ordinary, nontemplate function. (Section 14.5.3). Before g++
  360.      implemented explicit specification, unqualified-ids could be
  361.      interpreted as a particular specialization of a templatized
  362.      function. Because this non-conforming behavior is no longer the
  363.      default behavior for g++, `-Wnon-template-friend' allows the
  364.      compiler to check existing code for potential trouble spots, and
  365.      is on by default.  This new compiler behavior can also be turned
  366.      off with the flag `-fguiding-decls', which activates the older,
  367.      non-specification compiler code, or with
  368.      `-Wno-non-template-friend' which keeps the conformant compiler
  369.      code but disables the helpful warning.
  370.  
  371. `-Wold-style-cast (C++ only)'
  372.      Warn if an old-style (C-style) cast is used within a C++ program.
  373.      The new-style casts (`static_cast', `reinterpret_cast', and
  374.      `const_cast') are less vulnerable to unintended effects.
  375.  
  376. `-Woverloaded-virtual (C++ only)'
  377.      Warn when a derived class function declaration may be an error in
  378.      defining a virtual function.  In a derived class, the definitions
  379.      of virtual functions must match the type signature of a virtual
  380.      function declared in the base class.  With this option, the
  381.      compiler warns when you define a function with the same name as a
  382.      virtual function, but with a type signature that does not match any
  383.      declarations from the base class.
  384.  
  385. `-Wno-pmf-conversions (C++ only)'
  386.      Disable the diagnostic for converting a bound pointer to member
  387.      function to a plain pointer.
  388.  
  389. `-Wsign-promo (C++ only)'
  390.      Warn when overload resolution chooses a promotion from unsigned or
  391.      enumeral type to a signed type over a conversion to an unsigned
  392.      type of the same size.  Previous versions of g++ would try to
  393.      preserve unsignedness, but the standard mandates the current
  394.      behavior.
  395.  
  396. `-Wsynth (C++ only)'
  397.      Warn when g++'s synthesis behavior does not match that of cfront.
  398.      For instance:
  399.  
  400.           struct A {
  401.             operator int ();
  402.             A& operator = (int);
  403.           };
  404.           
  405.           main ()
  406.           {
  407.             A a,b;
  408.             a = b;
  409.           }
  410.  
  411.      In this example, g++ will synthesize a default `A& operator =
  412.      (const A&);', while cfront will use the user-defined `operator ='.
  413.  
  414. 
  415. File: gcc.info,  Node: Warning Options,  Next: Debugging Options,  Prev: C++ Dialect Options,  Up: Invoking GCC
  416.  
  417. Options to Request or Suppress Warnings
  418. =======================================
  419.  
  420.    Warnings are diagnostic messages that report constructions which are
  421. not inherently erroneous but which are risky or suggest there may have
  422. been an error.
  423.  
  424.    You can request many specific warnings with options beginning `-W',
  425. for example `-Wimplicit' to request warnings on implicit declarations.
  426. Each of these specific warning options also has a negative form
  427. beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'.
  428. This manual lists only one of the two forms, whichever is not the
  429. default.
  430.  
  431.    These options control the amount and kinds of warnings produced by
  432. GCC:
  433.  
  434. `-fsyntax-only'
  435.      Check the code for syntax errors, but don't do anything beyond
  436.      that.
  437.  
  438. `-pedantic'
  439.      Issue all the warnings demanded by strict ANSI C and ISO C++;
  440.      reject all programs that use forbidden extensions.
  441.  
  442.      Valid ANSI C and ISO C++ programs should compile properly with or
  443.      without this option (though a rare few will require `-ansi').
  444.      However, without this option, certain GNU extensions and
  445.      traditional C and C++ features are supported as well.  With this
  446.      option, they are rejected.
  447.  
  448.      `-pedantic' does not cause warning messages for use of the
  449.      alternate keywords whose names begin and end with `__'.  Pedantic
  450.      warnings are also disabled in the expression that follows
  451.      `__extension__'.  However, only system header files should use
  452.      these escape routes; application programs should avoid them.
  453.      *Note Alternate Keywords::.
  454.  
  455.      This option is not intended to be useful; it exists only to satisfy
  456.      pedants who would otherwise claim that GCC fails to support the
  457.      ANSI standard.
  458.  
  459.      Some users try to use `-pedantic' to check programs for strict ANSI
  460.      C conformance.  They soon find that it does not do quite what they
  461.      want: it finds some non-ANSI practices, but not all--only those
  462.      for which ANSI C *requires* a diagnostic.
  463.  
  464.      A feature to report any failure to conform to ANSI C might be
  465.      useful in some instances, but would require considerable
  466.      additional work and would be quite different from `-pedantic'.  We
  467.      don't have plans to support such a feature in the near future.
  468.  
  469. `-pedantic-errors'
  470.      Like `-pedantic', except that errors are produced rather than
  471.      warnings.
  472.  
  473. `-w'
  474.      Inhibit all warning messages.
  475.  
  476. `-Wno-import'
  477.      Inhibit warning messages about the use of `#import'.
  478.  
  479. `-Wchar-subscripts'
  480.      Warn if an array subscript has type `char'.  This is a common cause
  481.      of error, as programmers often forget that this type is signed on
  482.      some machines.
  483.  
  484. `-Wcomment'
  485.      Warn whenever a comment-start sequence `/*' appears in a `/*'
  486.      comment, or whenever a Backslash-Newline appears in a `//' comment.
  487.  
  488. `-Wformat'
  489.      Check calls to `printf' and `scanf', etc., to make sure that the
  490.      arguments supplied have types appropriate to the format string
  491.      specified.
  492.  
  493. `-Wimplicit-int'
  494.      Warn when a declaration does not specify a type.
  495.  
  496. `-Wimplicit-function-declaration'
  497. `-Werror-implicit-function-declaration'
  498.      Give a warning (or error) whenever a function is used before being
  499.      declared.
  500.  
  501. `-Wimplicit'
  502.      Same as `-Wimplicit-int' and `-Wimplicit-function-'
  503.      `declaration'.
  504.  
  505. `-Wmain'
  506.      Warn if the type of `main' is suspicious.  `main' should be a
  507.      function with external linkage, returning int, taking either zero
  508.      arguments, two, or three arguments of appropriate types.
  509.  
  510. `-Wmultichar'
  511.      Warn if a multicharacter constant (`'FOOF'') is used.  Usually they
  512.      indicate a typo in the user's code, as they have
  513.      implementation-defined values, and should not be used in portable
  514.      code.
  515.  
  516. `-Wparentheses'
  517.      Warn if parentheses are omitted in certain contexts, such as when
  518.      there is an assignment in a context where a truth value is
  519.      expected, or when operators are nested whose precedence people
  520.      often get confused about.
  521.  
  522.      Also warn about constructions where there may be confusion to which
  523.      `if' statement an `else' branch belongs.  Here is an example of
  524.      such a case:
  525.  
  526.           {
  527.             if (a)
  528.               if (b)
  529.                 foo ();
  530.             else
  531.               bar ();
  532.           }
  533.  
  534.      In C, every `else' branch belongs to the innermost possible `if'
  535.      statement, which in this example is `if (b)'.  This is often not
  536.      what the programmer expected, as illustrated in the above example
  537.      by indentation the programmer chose.  When there is the potential
  538.      for this confusion, GNU C will issue a warning when this flag is
  539.      specified.  To eliminate the warning, add explicit braces around
  540.      the innermost `if' statement so there is no way the `else' could
  541.      belong to the enclosing `if'.  The resulting code would look like
  542.      this:
  543.  
  544.           {
  545.             if (a)
  546.               {
  547.                 if (b)
  548.                   foo ();
  549.                 else
  550.                   bar ();
  551.               }
  552.           }
  553.  
  554. `-Wreturn-type'
  555.      Warn whenever a function is defined with a return-type that
  556.      defaults to `int'.  Also warn about any `return' statement with no
  557.      return-value in a function whose return-type is not `void'.
  558.  
  559. `-Wswitch'
  560.      Warn whenever a `switch' statement has an index of enumeral type
  561.      and lacks a `case' for one or more of the named codes of that
  562.      enumeration.  (The presence of a `default' label prevents this
  563.      warning.)  `case' labels outside the enumeration range also
  564.      provoke warnings when this option is used.
  565.  
  566. `-Wtrigraphs'
  567.      Warn if any trigraphs are encountered (assuming they are enabled).
  568.  
  569. `-Wunused'
  570.      Warn whenever a variable is unused aside from its declaration,
  571.      whenever a function is declared static but never defined, whenever
  572.      a label is declared but not used, and whenever a statement
  573.      computes a result that is explicitly not used.
  574.  
  575.      In order to get a warning about an unused function parameter, you
  576.      must specify both `-W' and `-Wunused'.
  577.  
  578.      To suppress this warning for an expression, simply cast it to
  579.      void.  For unused variables, parameters and labels, use the
  580.      `unused' attribute (*note Variable Attributes::.).
  581.  
  582. `-Wuninitialized'
  583.      An automatic variable is used without first being initialized.
  584.  
  585.      These warnings are possible only in optimizing compilation,
  586.      because they require data flow information that is computed only
  587.      when optimizing.  If you don't specify `-O', you simply won't get
  588.      these warnings.
  589.  
  590.      These warnings occur only for variables that are candidates for
  591.      register allocation.  Therefore, they do not occur for a variable
  592.      that is declared `volatile', or whose address is taken, or whose
  593.      size is other than 1, 2, 4 or 8 bytes.  Also, they do not occur for
  594.      structures, unions or arrays, even when they are in registers.
  595.  
  596.      Note that there may be no warning about a variable that is used
  597.      only to compute a value that itself is never used, because such
  598.      computations may be deleted by data flow analysis before the
  599.      warnings are printed.
  600.  
  601.      These warnings are made optional because GCC is not smart enough
  602.      to see all the reasons why the code might be correct despite
  603.      appearing to have an error.  Here is one example of how this can
  604.      happen:
  605.  
  606.           {
  607.             int x;
  608.             switch (y)
  609.               {
  610.               case 1: x = 1;
  611.                 break;
  612.               case 2: x = 4;
  613.                 break;
  614.               case 3: x = 5;
  615.               }
  616.             foo (x);
  617.           }
  618.  
  619.      If the value of `y' is always 1, 2 or 3, then `x' is always
  620.      initialized, but GCC doesn't know this.  Here is another common
  621.      case:
  622.  
  623.           {
  624.             int save_y;
  625.             if (change_y) save_y = y, y = new_y;
  626.             ...
  627.             if (change_y) y = save_y;
  628.           }
  629.  
  630.      This has no bug because `save_y' is used only if it is set.
  631.  
  632.      Some spurious warnings can be avoided if you declare all the
  633.      functions you use that never return as `noreturn'.  *Note Function
  634.      Attributes::.
  635.  
  636. `-Wunknown-pragmas'
  637.      Warn when a #pragma directive is encountered which is not
  638.      understood by GCC.  If this command line option is used, warnings
  639.      will even be issued for unknown pragmas in system header files.
  640.      This is not the case if the warnings were only enabled by the
  641.      `-Wall' command line option.
  642.  
  643. `-Wall'
  644.      All of the above `-W' options combined.  This enables all the
  645.      warnings about constructions that some users consider
  646.      questionable, and that are easy to avoid (or modify to prevent the
  647.      warning), even in conjunction with macros.
  648.  
  649.    The following `-W...' options are not implied by `-Wall'.  Some of
  650. them warn about constructions that users generally do not consider
  651. questionable, but which occasionally you might wish to check for;
  652. others warn about constructions that are necessary or hard to avoid in
  653. some cases, and there is no simple way to modify the code to suppress
  654. the warning.
  655.  
  656. `-W'
  657.      Print extra warning messages for these events:
  658.  
  659.         * A nonvolatile automatic variable might be changed by a call to
  660.           `longjmp'.  These warnings as well are possible only in
  661.           optimizing compilation.
  662.  
  663.           The compiler sees only the calls to `setjmp'.  It cannot know
  664.           where `longjmp' will be called; in fact, a signal handler
  665.           could call it at any point in the code.  As a result, you may
  666.           get a warning even when there is in fact no problem because
  667.           `longjmp' cannot in fact be called at the place which would
  668.           cause a problem.
  669.  
  670.         * A function can return either with or without a value.
  671.           (Falling off the end of the function body is considered
  672.           returning without a value.)  For example, this function would
  673.           evoke such a warning:
  674.  
  675.                foo (a)
  676.                {
  677.                  if (a > 0)
  678.                    return a;
  679.                }
  680.  
  681.         * An expression-statement or the left-hand side of a comma
  682.           expression contains no side effects.  To suppress the
  683.           warning, cast the unused expression to void.  For example, an
  684.           expression such as `x[i,j]' will cause a warning, but
  685.           `x[(void)i,j]' will not.
  686.  
  687.         * An unsigned value is compared against zero with `<' or `<='.
  688.  
  689.         * A comparison like `x<=y<=z' appears; this is equivalent to
  690.           `(x<=y ? 1 : 0) <= z', which is a different interpretation
  691.           from that of ordinary mathematical notation.
  692.  
  693.         * Storage-class specifiers like `static' are not the first
  694.           things in a declaration.  According to the C Standard, this
  695.           usage is obsolescent.
  696.  
  697.         * If `-Wall' or `-Wunused' is also specified, warn about unused
  698.           arguments.
  699.  
  700.         * A comparison between signed and unsigned values could produce
  701.           an incorrect result when the signed value is converted to
  702.           unsigned.  (But don't warn if `-Wno-sign-compare' is also
  703.           specified.)
  704.  
  705.         * An aggregate has a partly bracketed initializer.  For
  706.           example, the following code would evoke such a warning,
  707.           because braces are missing around the initializer for `x.h':
  708.  
  709.                struct s { int f, g; };
  710.                struct t { struct s h; int i; };
  711.                struct t x = { 1, 2, 3 };
  712.  
  713.         * An aggregate has an initializer which does not initialize all
  714.           members.  For example, the following code would cause such a
  715.           warning, because `x.h' would be implicitly initialized to
  716.           zero:
  717.  
  718.                struct s { int f, g, h; };
  719.                struct s x = { 3, 4 };
  720.  
  721. `-Wtraditional'
  722.      Warn about certain constructs that behave differently in
  723.      traditional and ANSI C.
  724.  
  725.         * Macro arguments occurring within string constants in the
  726.           macro body.  These would substitute the argument in
  727.           traditional C, but are part of the constant in ANSI C.
  728.  
  729.         * A function declared external in one block and then used after
  730.           the end of the block.
  731.  
  732.         * A `switch' statement has an operand of type `long'.
  733.  
  734.         * A non-`static' function declaration follows a `static' one.
  735.           This construct is not accepted by some traditional C
  736.           compilers.
  737.  
  738. `-Wundef'
  739.      Warn if an undefined identifier is evaluated in an `#if' directive.
  740.  
  741. `-Wshadow'
  742.      Warn whenever a local variable shadows another local variable.
  743.  
  744. `-Wid-clash-LEN'
  745.      Warn whenever two distinct identifiers match in the first LEN
  746.      characters.  This may help you prepare a program that will compile
  747.      with certain obsolete, brain-damaged compilers.
  748.  
  749. `-Wlarger-than-LEN'
  750.      Warn whenever an object of larger than LEN bytes is defined.
  751.  
  752. `-Wpointer-arith'
  753.      Warn about anything that depends on the "size of" a function type
  754.      or of `void'.  GNU C assigns these types a size of 1, for
  755.      convenience in calculations with `void *' pointers and pointers to
  756.      functions.
  757.  
  758. `-Wbad-function-cast'
  759.      Warn whenever a function call is cast to a non-matching type.  For
  760.      example, warn if `int malloc()' is cast to `anything *'.
  761.  
  762. `-Wcast-qual'
  763.      Warn whenever a pointer is cast so as to remove a type qualifier
  764.      from the target type.  For example, warn if a `const char *' is
  765.      cast to an ordinary `char *'.
  766.  
  767. `-Wcast-align'
  768.      Warn whenever a pointer is cast such that the required alignment
  769.      of the target is increased.  For example, warn if a `char *' is
  770.      cast to an `int *' on machines where integers can only be accessed
  771.      at two- or four-byte boundaries.
  772.  
  773. `-Wwrite-strings'
  774.      Give string constants the type `const char[LENGTH]' so that
  775.      copying the address of one into a non-`const' `char *' pointer
  776.      will get a warning.  These warnings will help you find at compile
  777.      time code that can try to write into a string constant, but only
  778.      if you have been very careful about using `const' in declarations
  779.      and prototypes.  Otherwise, it will just be a nuisance; this is
  780.      why we did not make `-Wall' request these warnings.
  781.  
  782. `-Wconversion'
  783.      Warn if a prototype causes a type conversion that is different
  784.      from what would happen to the same argument in the absence of a
  785.      prototype.  This includes conversions of fixed point to floating
  786.      and vice versa, and conversions changing the width or signedness
  787.      of a fixed point argument except when the same as the default
  788.      promotion.
  789.  
  790.      Also, warn if a negative integer constant expression is implicitly
  791.      converted to an unsigned type.  For example, warn about the
  792.      assignment `x = -1' if `x' is unsigned.  But do not warn about
  793.      explicit casts like `(unsigned) -1'.
  794.  
  795. `-Wsign-compare'
  796.      Warn when a comparison between signed and unsigned values could
  797.      produce an incorrect result when the signed value is converted to
  798.      unsigned.  This warning is also enabled by `-W'; to get the other
  799.      warnings of `-W' without this warning, use `-W -Wno-sign-compare'.
  800.  
  801. `-Waggregate-return'
  802.      Warn if any functions that return structures or unions are defined
  803.      or called.  (In languages where you can return an array, this also
  804.      elicits a warning.)
  805.  
  806. `-Wstrict-prototypes'
  807.      Warn if a function is declared or defined without specifying the
  808.      argument types.  (An old-style function definition is permitted
  809.      without a warning if preceded by a declaration which specifies the
  810.      argument types.)
  811.  
  812. `-Wmissing-prototypes'
  813.      Warn if a global function is defined without a previous prototype
  814.      declaration.  This warning is issued even if the definition itself
  815.      provides a prototype.  The aim is to detect global functions that
  816.      fail to be declared in header files.
  817.  
  818. `-Wmissing-declarations'
  819.      Warn if a global function is defined without a previous
  820.      declaration.  Do so even if the definition itself provides a
  821.      prototype.  Use this option to detect global functions that are
  822.      not declared in header files.
  823.  
  824. `-Wmissing-noreturn'
  825.      Warn about functions which might be candidates for attribute
  826.      `noreturn'.  Note these are only possible candidates, not absolute
  827.      ones.  Care should be taken to manually verify functions actually
  828.      do not ever return before adding the `noreturn' attribute,
  829.      otherwise subtle code generation bugs could be introduced.
  830.  
  831. `-Wredundant-decls'
  832.      Warn if anything is declared more than once in the same scope,
  833.      even in cases where multiple declaration is valid and changes
  834.      nothing.
  835.  
  836. `-Wnested-externs'
  837.      Warn if an `extern' declaration is encountered within an function.
  838.  
  839. `-Winline'
  840.      Warn if a function can not be inlined, and either it was declared
  841.      as inline, or else the `-finline-functions' option was given.
  842.  
  843. `-Wlong-long'
  844.      Warn if `long long' type is used.  This is default.  To inhibit
  845.      the warning messages, use `-Wno-long-long'.  Flags `-Wlong-long'
  846.      and `-Wno-long-long' are taken into account only when `-pedantic'
  847.      flag is used.
  848.  
  849. `-Werror'
  850.      Make all warnings into errors.
  851.  
  852.